from django.core.management.base import BaseCommand
from apiapp.models import User
class Command(BaseCommand):
    help = 'The Zen of Python'

    def handle(self, *args, **options):
        if not User.objects.filter(email='admin@example.com').exists():
            User.objects.get_or_create(
                username='admin@example.com',
                email='admin@example.com',
                password='1',
                isAdmin=True,
                first_name='Admin',
                last_name='Admin',
                                     )
            self.stdout.write(self.style.SUCCESS('Admin created'))

        self.stdout.write(self.style.ERROR('Admin already exists'))